﻿<%@ Page Title="Add Player" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="AddPlayer.aspx.vb" Inherits="WSAD_Assignment.AddPlayer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">

    <h3 class="form-signup-heading">Add New Player</h3>

    <div class="form-group">
        <asp:Label ID="lblFullName" AssociatedControlID="txtFullName" runat="server" CssClass="col-sm-2 control-label" Text="Full Name"></asp:Label>

   		<div class="col-sm-4">
            <asp:TextBox ID="txtFullName" name="txtFullName" runat="server" CssClass="form-control" placeholder="Full Name"></asp:TextBox>
            <asp:RequiredFieldValidator runat="server" ControlToValidate="txtFullName" Display="Dynamic" CssClass="field-validation-error" ErrorMessage="This is a required field!" />
            <asp:RegularExpressionValidator runat="server" ControlToValidate="txtFullName" Display="Dynamic" ErrorMessage="This field must be between 5 and 50 characters long!"
                    CssClass="field-validation-error" ValidationExpression="^[a-zA-Z0-9'@&#.,\s]{5,50}$" />
   		</div>
    </div>

    <div class="form-group">
        <asp:Label ID="lblClubName" AssociatedControlID="ddlClubName" runat="server" CssClass="col-sm-2 control-label" Text="Club"></asp:Label>

   		<div class="col-sm-3">
            <asp:DropDownList ID="ddlClubName" name="ddlClubName" runat="server" DataSourceID="ClubsDataSource3" DataTextField="ClubName" DataValueField="ID" CssClass="form-control">
            </asp:DropDownList>
            <asp:SqlDataSource ID="ClubsDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ClubsConnectionString %>" ProviderName="<%$ ConnectionStrings:ClubsConnectionString.ProviderName %>" SelectCommand="SELECT [ID], [ClubName] FROM [Clubs]"></asp:SqlDataSource>
   		</div>
    </div>

    <div class="form-group">
        <asp:Label ID="lblDateOfBirth" AssociatedControlID="txtDateOfBirth" runat="server" CssClass="col-sm-2 control-label" Text="Date of Birth"></asp:Label>

   		<div class="col-sm-2">
            <asp:TextBox ID="txtDateOfBirth" name="txtDateOfBirth" runat="server" CssClass="form-control" placeholder="Date of Birth"></asp:TextBox>
            <asp:RequiredFieldValidator runat="server" ControlToValidate="txtDateOfBirth" Display="Dynamic" CssClass="field-validation-error" ErrorMessage="This is a required field!" />
            <asp:RegularExpressionValidator runat="server" ControlToValidate="txtDateOfBirth" Display="Dynamic" ErrorMessage="Please enter a valid date!"
                    CssClass="field-validation-error" ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$" />
   		</div>
    </div>

    <script type="text/javascript">
        var dp_now = new Date();

        $( "#<%= txtDateOFBirth.ClientID%>" ).datepicker({
                dateFormat: 'dd/mm/yy',
                minDate: "01/01/1900",
                maxDate: dp_now
         })
   </script>

   <div class="form-group">
        <asp:Label ID="lblNationality" AssociatedControlID="ddlNationality" runat="server" CssClass="col-sm-2 control-label" Text="Nationality"></asp:Label>

   		<div class="col-sm-3">
            <asp:DropDownList ID="ddlNationality" name="ddlNationality" runat="server" DataSourceID="CountriesDataSource" DataTextField="CountryName" DataValueField="ID" CssClass="form-control">
            </asp:DropDownList>
            <asp:SqlDataSource ID="CountriesDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ClubsConnectionString %>" ProviderName="<%$ ConnectionStrings:ClubsConnectionString.ProviderName %>" SelectCommand="SELECT [CountryName], [ID] FROM [Countries]"></asp:SqlDataSource>
        </div>
    </div> 

    <div class="form-group">
        <asp:Label ID="lblHeight" AssociatedControlID="txtHeight" runat="server" CssClass="col-sm-2 control-label" Text="Height (cm)"></asp:Label>

   		<div class="col-sm-2">
            <asp:TextBox ID="txtHeight" name="txtHeight" runat="server" CssClass="form-control" placeholder="Height (cm)"></asp:TextBox>
            <asp:RequiredFieldValidator runat="server" ControlToValidate="txtHeight" Display="Dynamic" CssClass="field-validation-error" ErrorMessage="This is a required field!" />
            <asp:RegularExpressionValidator runat="server" ControlToValidate="txtHeight" Display="Dynamic" ErrorMessage="Please enter a valid numeric value!"
                    CssClass="field-validation-error" ValidationExpression="^\d+(\.\d{1,2})?$" />
   		</div>
    </div> 

    <div class="form-group">
        <asp:Label ID="lblWeight" AssociatedControlID="txtWeight" runat="server" CssClass="col-sm-2 control-label" Text="Weight (kg)"></asp:Label>

   		<div class="col-sm-2">
            <asp:TextBox ID="txtWeight" name="txtWeight" runat="server" CssClass="form-control" placeholder="Weight (kg)"></asp:TextBox>
            <asp:RequiredFieldValidator runat="server" ControlToValidate="txtWeight" Display="Dynamic" CssClass="field-validation-error" ErrorMessage="This is a required field!" />
            <asp:RegularExpressionValidator runat="server" ControlToValidate="txtWeight" Display="Dynamic" ErrorMessage="Please enter a valid numeric value!"
                    CssClass="field-validation-error" ValidationExpression="^\d+(\.\d{1,2})?$" />
   		</div>
    </div>

   <div class="form-group">
        <asp:Label ID="lblPosition" AssociatedControlID="ddlPosition" runat="server" CssClass="col-sm-2 control-label" Text="Position"></asp:Label>

   		<div class="col-sm-3">
            <asp:DropDownList ID="ddlPosition" name="ddlPosition" runat="server" DataSourceID="PositionsDataSource" DataTextField="PositionName" DataValueField="ID" CssClass="form-control">
            </asp:DropDownList>
            <asp:SqlDataSource ID="PositionsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ClubsConnectionString %>" ProviderName="<%$ ConnectionStrings:ClubsConnectionString.ProviderName %>" SelectCommand="SELECT [PositionName], [ID] FROM [Positions]"></asp:SqlDataSource>
         </div>
   </div>   
               
    <div class="form-group">
        <asp:Label ID="lblPreferredFoot" AssociatedControlID="rblPreferredFoot" runat="server" CssClass="col-sm-2 control-label" Text="Preferred Foot"></asp:Label>

   		<div class="col-sm-2">
           <asp:RadioButtonList ID="rblPreferredFoot" Font-Names="rblPreferredFoot" runat="server" RepeatDirection="Horizontal">
                <asp:ListItem Selected="True" Value="Left"></asp:ListItem>
                <asp:ListItem>Right</asp:ListItem>
            </asp:RadioButtonList>
   		</div>
    </div>               
           
    <div class="form-group">
        <asp:Label ID="lblProfilePicture" AssociatedControlID="fuProfilePicture" runat="server" CssClass="col-sm-2 control-label" Text="Profile Picture"></asp:Label>

   		<div class="col-sm-5">
            <asp:FileUpload ID="fuProfilePicture" name="fuProfilePicture" runat="server" />
   		</div>
    </div>               

    <div class="form-group">
        <asp:LinkButton ID="btnAddPlayer" 
                runat="server"
                CssClass="btn btn-success"    
                OnClick="btnAddPlayer_Click"
                CausesValidation="True">
                <i aria-hidden="true" class="glyphicon glyphicon-plus"></i> Add Player
        </asp:LinkButton>

        <asp:LinkButton ID="btnBackClubList" 
                runat="server"
                CssClass="btn btn-default cancel" 
                CausesValidation="False"   
                OnClick="btnBackClubList_Click">
                <i aria-hidden="true" class="glyphicon glyphicon-arrow-left"></i> Back to Club List
        </asp:LinkButton>
    </div>

</asp:Content>
